{% extends 'base_with_top_menu.html' %}

{% block title %}{{ book.title }}{% endblock %}

{% block header %}{{ book.title }}{% endblock %}

{% block content %}
<div class='content_form'>
<form action='.' method='post'>
    <table>
        <tr>
            <td>Location: </td>
            <td>
                <select name='location'>
                        <option value='all'>All</option>
                    {% for location in book.locations %}
                        <option value='{{ location }}'>{{ location }}</option>
                    {% endfor %}
                </select>
            </td>
        </tr><tr>
            <td>Only available: </td>
            <td>
                <input type='checkbox' name='available' value='available' >
            </td>
        </tr><tr>
            <td></td><td>
                <input type='submit'  name='action' value='Search'>
            </td></tr>
    </table>
</form>
</div>
<div style='margin-top: 1em'>
{% if book.authors %}
<b>Authors: </b>
{{ book.authors|join:', '}}
{% else %}
<b>No authors.</b>
{% endif %}
<ul class='booklist'>
{% for item in book.items %}
<li><b><a href='{{ item.url }}'>>></a></b>:
    <ul>
    <li>Location: {{ item.location }}</li>
    <li>State: {{ item.state }}</li>
    <li>Publisher: {{ item.publisher }}</li>
    <li>Year: {{ item.year }}</li>
    <li>Description: {{ item.description }}</li>
    </ul>
</li>
{% empty %}
<b>Sorry, no copies.</b>
{% endfor %}
</ul>
</div>
{% endblock %}